package com.egreen.common;

/**
 * @author cloudJiang
 * @date 2022/6/24 9:23
 */
public enum States {
    OK(20000, "成功"),
    ERR_BAD_REQUEST(40000, "请求参数错误"),
    ERR_UNIQUE(40100, "该值已存在"),
    ERR_USER_NOT_FOUND(40101, "该值不存在"),
    ERR_ADMIN_NOT_FOUND(40102,"该管理员不存在"),
    ERR_JWT_EXPIRED(40900, "登录过期"),
    ERR_JWT_MALFORMED(40901, "数据无效"),
    ERR_JWT_SIGNATURE(40902, "签名错误"),
    ERR_INSERT(50000, "插入数据错误"),
    ERR_UPDATE(50001, "更新数据错误"),
    ERR_SELECT(50002, "查询数据失败"),
    ERR_DELETE(50003, "删除数据失败"),
    ERR_SQL(50004, "数据库异常"),
    ERR_INTERNAL_SERVER_ERROR(50100, "服务器错误"),
    ERR_UNKNOWN(51000, "服务器忙，请稍后再试"),
    ERR_POINT_ACCOUNT(52000, ""),
    ERR_POINT_UPDATE(52100, "商品过于火爆，请稍后再试"),
    ERR_ALIPAY_SERVER(41000,"支付宝服务器错误,调用AlipaySDK失败"),
    ERR_ALIPAY_ACCESSTOKEN(41001,"支付宝服务器错误,获取access_token失败"),

    //积分商城异常类型
    USER_INFO_NULL(30000,"用户信息不能为空"),
    EMAIL_ERROR(30001,"邮箱格式错误"),
    MOBILE_ERROR(30002,"手机格式错误"),
    USERNAME_EXISTS(30003,"用户名已存在"),
    USER_REGISTER_ERROR(30004,"用户注册失败"),
    USERNAME_NOT_EXISTS(30005,"用户名不存在"),
    PASSWORD_ERROR(30006,"密码错误"),
    PARAMETER_NULL(30007,"参数为空"),
    NOT_LOGIN(30008,"未登录"),
    CART_ADD_ERROR(30009,"添加购物车失败"),
    PRODUCT_NOT_EXISTS(30010,"商品不存在"),
    PRODUCT_STOCK_ERROR(30011,"商品库存不足"),
    CART_UPDATE_ERROR(30012,"更新购物车失败"),
    CART_UPDATE_PARAMETER_ERROR(30013,"更新购物车参数异常"),
    CART_UPDATE_STOCK_ERROR(30014,"更新商品库存失败"),
    CART_REMOVE_ERROR(30015,"删除购物车失败"),
    ORDERS_CREATE_ERROR(30016,"创建订单主表失败"),
    ORDER_DETAIL_CREATE_ERROR(30017,"创建订单详情失败"),
    USER_ADDRESS_ADD_ERROR(30018,"添加新地址失败"),
    USER_ADDRESS_SET_DEFAULT_ERROR(30019,"默认地址修改失败"),

    //终端模块异常类型
    ERR_TERMINALCOUNT_TERMINAL_INSERT(41001,"数据库写入错误，终端注册失败"),
    ERR_TERMINALCOUNT_TERMINAL_REGISTER_EXISTED(41002,"终端已存在，注册失败"),
    ERR_TERMINALCOUNT_TERMINAL_DELETE(41003,"数据库删除错误，终端删除失败"),
    ERR_TERMINALCOUNT_TERMINAL_UPDATA(41004,"数据库更新错误，状态更新不成功"),
    ERR_TERMINALCOUNT_TERMINAL_LOGIN_NOTEXISTED(41005,"终端不存在，登录失败"),
    ERR_TERMINALCOUNT_TERMINAL_STATE_ABNORMAL(41006,"终端状态异常"),
    ERR_TERMINALCOUNT_TERMINAL_ADDRESS_MISSING(41007,"终端地址缺失"),


    ERR_TERMINAL_TRANSACTIONRECORDS_INSERT(42001,"数据库写入错误，终端交易记录插入失败"),
    ERR_TERMINAL_TRANSACTIONRECORDS_DELETE(42002,"数据库删除错误，记录为0")

    ;




    private int states;
    private String description;

    public int getStates() {
        return states;
    }
    public String getDescription() {
        return description;
    }

    States(int states, String description) {
        this.states = states;
        this.description = description;
    }
}
